
package de.fhhof.brst.event;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import de.fhhof.brst.dao.EventDAO;
import de.fhhof.brst.dao.HibernateEventDAO;
import de.fhhof.brst.dao.HibernateUserDAO;
import de.fhhof.brst.data.Booking;
import de.fhhof.brst.data.Event;
import de.fhhof.brst.session.SessionBean;
@ManagedBean
@RequestScoped
public class Events implements Serializable {
  /**
   * 
   */
  private static final long serialVersionUID =  -7152376465198038630L;

  private de.fhhof.brst.data.Event event;

  private List<de.fhhof.brst.data.Event> eventList =  new ArrayList<Event>();

  private de.fhhof.brst.dao.EventDAO eventDAO =  HibernateEventDAO.getHibernateEventDAO();

  public Events() {
		List<Event> tempEvents = eventDAO.getAllEvents();
		for (Event event : tempEvents) {
			if(!event.isLotteryStarted()) {
				eventList.add(event);
			}
		}
  }

  public de.fhhof.brst.data.Event getEvent() {
		return event;
  }

  public void setEvent(de.fhhof.brst.data.Event event) {
		this.event = event;
  }

  public List<de.fhhof.brst.data.Event> getEventList() {
		return eventList;
  }

  public void setEventList(List<Event> eventList) {
		this.eventList = eventList;
  }

  public de.fhhof.brst.dao.EventDAO getEventDAO() {
		return eventDAO;
  }

  public void setEventDAO(de.fhhof.brst.dao.EventDAO eventDAO) {
		this.eventDAO = eventDAO;
  }

}
